home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Presenta / FORMDEMO.ZIP / DEMO.SX_ / DEMO.SX
Text File  |  1997-09-14  |  3KB  |  103 lines

  1. ////////////////////////////////
  2. // Sample script
  3.  
  4. sound_test:
  5.     if SOUND_DEVICE
  6.         set condition 30
  7.  
  8. /////////////////////////////
  9. install_icon:
  10.     $target = "formula"
  11.     $title = "Formula Graphics"
  12.     $destdir = get directory
  13.     DDE "PROGMAN" string "[DeleteGroup(",$title,")]"
  14.     DDE "PROGMAN" string "[CreateGroup(",$title,")]"
  15.     DDE "PROGMAN" string "[ShowGroup(1)]"
  16.     DDE "PROGMAN" string "[AddItem(",$destdir,"\",$target,".exe,",$title,",",$destdir,"\",$target,".exe,0)]"
  17.  
  18. /////////////////////////////
  19. init_balls:
  20.     ball_list = new list
  21.     ball = new script "ball.sxt"
  22.     ball_list add ball
  23.     $name = "ball_red.gif"
  24.     ball call init: @name,0,0,5,2
  25.  
  26.     ball = new script "ball.sxt"
  27.     ball_list add ball
  28.     $name = "ball_grn.gif"
  29.     ball call init: @name,0,360,2,-5
  30.  
  31.     ball = new script "ball.sxt"
  32.     ball_list add ball
  33.     $name = "ball_blu.gif"
  34.     ball call init: @name,0,180,-4,3
  35.     free ball
  36.  
  37. /////////////////////////////////////////
  38. play_balls: mess, wparam, loword, hiword
  39.     for n = 0 to 2
  40.         ball = ball_list get n
  41.         ball call show
  42.     free ball
  43.     update sprites
  44.  
  45. ////////////////////////////////
  46. clear_balls:
  47.     free ball_list
  48.     update sprites
  49.  
  50. ///////////////////////////
  51. next_hyperpage:
  52.     page = strval getrange "700/710"
  53.     page = page + 1
  54.     if page > 703 then page = 700
  55.     set condition "-700/710,",page
  56.  
  57. ///////////////////////////
  58. show_edit_boxes:
  59.     set editbox "edit box 1" = "Harrow !"
  60.     $abc = "Using the Formula Graphics high level object oriented language, you can write text to the contents of an edit box. You can also read the information typed into an edit box. The information can then be analysed in any way imaginable."
  61.     set editbox "edit box 2" = $abc
  62.  
  63.     element_list = new byte[20][30]
  64.     $element_list[0] = "Picture";"Animation";"Sound";"Video";"Text";"Picture Button";"Text Button";"Hot Area";"Hot Color";"Hypertext";"Edit box";"List Box";"Graph"
  65.     for n = 0 to 12
  66.         index = listbox "list box 1" add $element_list[n]
  67.  
  68. /////////////////////////
  69. setup_graph:
  70.     colors = new byte[3][3]
  71.     colors[0][0] = 200,130,100
  72.     colors[1][0] = 100,180,130
  73.     colors[2][0] = 100,160,210
  74.  
  75. ///////////////////////////
  76. graph_data:
  77.     data = new float[3][4]
  78.     for n,m = 0,0 to 2,3
  79.         data[n][m] = 10 + rnd 90
  80.     return @data, @colors, 0, 100, 10
  81.  
  82. ///////////////////////////
  83. pie_graph_data:
  84.     data = new float[3]
  85.     max = 0
  86.     for n = 0 to 2
  87.         data[n] = 20 + rnd 80
  88.         max = max + data[n]
  89.     for n = 0 to 2
  90.         data[n] = floor (data[n] / max * 1000) / 10
  91.  
  92.     return @data, @colors, 0, 100, 0
  93.  
  94. ///////////////////////////
  95. play_game:
  96.     killer = new script "killmain.sxt"
  97.     killer call start
  98.     free killer
  99.     update sprites
  100.  
  101. ///////////////////////////////////
  102. /////////////////////////////////
  103.